package o;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.security.NoSuchAlgorithmException;
import java.security.Security;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.annotation.Nullable;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.X509TrustManager;

public class fwy {
    private static final fwy ˏ = ˊ();
    private static final Logger ॱ = Logger.getLogger(fuv.class.getName());

    public static fwy ˋ() {
        return ˏ;
    }

    public String ᐝ() {
        return "OkHttp";
    }

    public void ॱ(SSLSocket sSLSocket, @Nullable String str, List<fut> list) {
    }

    public void ˏ(SSLSocket sSLSocket) {
    }

    @Nullable
    public String ˊ(SSLSocket sSLSocket) {
        return null;
    }

    public void ˋ(Socket socket, InetSocketAddress inetSocketAddress, int i) throws IOException {
        socket.connect(inetSocketAddress, i);
    }

    public void ˏ(int i, String str, @Nullable Throwable th) {
        ॱ.log(i == 5 ? Level.WARNING : Level.INFO, str, th);
    }

    public boolean ˊ(String str) {
        return true;
    }

    public Object ˏ(String str) {
        if (ॱ.isLoggable(Level.FINE)) {
            return new Throwable(str);
        }
        return null;
    }

    public void ˎ(String str, Object obj) {
        if (obj == null) {
            str = str + " To see where this was allocated, set the OkHttpClient logger level to FINE: Logger.getLogger(OkHttpClient.class.getName()).setLevel(Level.FINE);";
        }
        ˏ(5, str, (Throwable) obj);
    }

    public static List<String> ˎ(List<fut> list) {
        List<String> arrayList = new ArrayList(list.size());
        int size = list.size();
        for (int i = 0; i < size; i++) {
            fut o_fut = (fut) list.get(i);
            if (o_fut != fut.HTTP_1_0) {
                arrayList.add(o_fut.toString());
            }
        }
        return arrayList;
    }

    public fxe ˊ(X509TrustManager x509TrustManager) {
        return new fwv(ˋ(x509TrustManager));
    }

    public static boolean ॱॱ() {
        if ("conscrypt".equals(System.getProperty("okhttp.platform"))) {
            return true;
        }
        return "Conscrypt".equals(Security.getProviders()[0].getName());
    }

    private static fwy ˊ() {
        fwy ˎ = fws.ˎ();
        if (ˎ != null) {
            return ˎ;
        }
        if (ॱॱ()) {
            ˎ = fwq.ˏ();
            if (ˎ != null) {
                return ˎ;
            }
        }
        ˎ = fwr.ˊ();
        if (ˎ != null) {
            return ˎ;
        }
        ˎ = fwt.ˏ();
        return ˎ == null ? new fwy() : ˎ;
    }

    static byte[] ॱ(List<fut> list) {
        fxi o_fxi = new fxi();
        int size = list.size();
        for (int i = 0; i < size; i++) {
            fut o_fut = (fut) list.get(i);
            if (o_fut != fut.HTTP_1_0) {
                o_fxi.ˊ(o_fut.toString().length());
                o_fxi.ˎ(o_fut.toString());
            }
        }
        return o_fxi.ʻॱ();
    }

    public SSLContext ॱ() {
        SSLContext instance;
        if ("1.7".equals(System.getProperty("java.specification.version"))) {
            try {
                instance = SSLContext.getInstance("TLSv1.2");
            } catch (NoSuchAlgorithmException e) {
            }
            return instance;
        }
        try {
            instance = SSLContext.getInstance("TLS");
            return instance;
        } catch (Throwable e2) {
            throw new IllegalStateException("No TLS provider", e2);
        }
    }

    public fxb ˋ(X509TrustManager x509TrustManager) {
        return new fwz(x509TrustManager.getAcceptedIssuers());
    }

    public void ˊ(SSLSocketFactory sSLSocketFactory) {
    }

    public String toString() {
        return getClass().getSimpleName();
    }
}
